<?php
/**
 * Created by PhpStorm.
 * User: wangjiangtao
 * Date: 2022/4/8
 * Time: 15:15
 */

namespace App\Console\Commands;


use App\Http\Model\CoolNumberShoppingMall\CoolNumber;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Redis;

class CheckUidList extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'checkUidList';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '检测uidDB数据是否需要补充';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }


    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        //检测用户uid
        if (Redis::lLen('USER:UID:GENERATED:DB') < 30000){
            Artisan::call('generateduid');
        }
        //公会uid
        if (Redis::lLen('UNION:UID:GENERATED:DB') < 1000){
            Artisan::call('generatedUnionUid');
        }
        //群聊uid
        if (Redis::lLen('GROUP:CHAT:UID:GENERATED:DB') < 1000){
            Artisan::call('generatedGroupChatUid');
        }

    }
}
